package com.jp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @类名称 LoginController
 * @类功能描述
 * @作者 蒋正午
 * @日期 2019-09-08  18:42
 */
@Controller
public class LoginController {

    @RequestMapping("/login")
    public ModelAndView login(String name, Model model){
        ModelAndView mv = new ModelAndView("index");
        mv.addObject("name",name);
//        model.addAttribute("name",name);
//        return "index";  // 默认会增加后缀.html
        return mv;
    }

}
